public class LC1646E {

    public int getMaximumGenerated(int n) {
        if (n==0)return 0;
        if (n==1)return 1;
        int[] nums=new int[n+1];
        nums[0]=0;
        nums[1]=1;
        int count=1;
        int i=1;
        int max=1;
        while (count<=n){
            if (2*i<=n){
                count++;
                nums[count]=nums[i];
            }
            if (2*i+1<=n){
                count++;
                nums[count]=nums[i]+nums[i+1];
                if (max<nums[count])
                    max=nums[count];
            }
            if (2*i>n || 2*i+1>n)break;
            i++;
        }
        return max;
    }

    public static void main(String[] args) {
        System.out.println(new LC1646E().getMaximumGenerated(7));
    }

}
